#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int vis[126];
vector<char>ret;
int res=0;
void dfs(int step, int n,string&str)
{
	if (step == n)
	{
		res++;
		for (int i = 0; i < n; i++)
		{
			cout << ret[i];
		}
		cout << ":"<<res << endl;      
	}

	for (int i = 0; i < str.size(); i++)
	{
		if (!vis[str[i]])
		{
			vis[str[i]] = 1;   
			ret.push_back(str[i]);   
			dfs(step + 1, n,str );              
			vis[str[i]] = 0;      
			ret.pop_back();       
		}
	}
}


int main()
{
	string str; cin >> str;
	dfs(0, str.size(), str);      
	return 0;
}
